package com.shop.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shop.pojo.sms.Sms_Spu_Bounds;
import com.shop.service.Sms_Spu_Bounds_Service;
import com.shop.to.SpuByBoundsTo;
import com.shop.utils.LayuiUtils;
import com.shop.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//spu积分设置信息
@RestController
@RequestMapping("/bounds")
public class Sms_Spu_Bounds_Controller {

    @Autowired
    private Sms_Spu_Bounds_Service sms_spu_bounds_service;

    /*
     * @Description 去请求头里接收json最后传去业务层来实现添加spu积分设置信息
     * @param spuByBoundsTo
     * @return com.shop.utils.R
     * @author liusupeng
     * @date 2020/11/6 8:59
     */
    @PostMapping("/saveBoundsBySpu")
    public R saveBoundsBySpu( @RequestBody SpuByBoundsTo spuByBoundsTo){
        return sms_spu_bounds_service.saveBoundsBySpu(spuByBoundsTo);
    }

    /**
     * 后台显示所有spu积分设置信息
     * @param page
     * @param limit
     * @param sms_spu_bounds
     * @return
     */
    @GetMapping("/find_Admin_Sms_Spu_Bounds")
    public LayuiUtils<Sms_Spu_Bounds> find_Admin_Sms_Spu_Bounds(Integer page, Integer limit, Sms_Spu_Bounds sms_spu_bounds){
        Page<Sms_Spu_Bounds> pages = new Page<>(page,limit);
        return sms_spu_bounds_service.find_admin_sms_spu_bounds(pages,sms_spu_bounds);
    }

    //目前无增删改

}
